<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:p="http://primefaces.org/ui">
	  
<f:view locale="#{switcher.currentLocale}">	  

<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

<style type="text/css">  
           .ui-widget {  
               font-size: 13px !important;  
           }  
</style>
       
<title>#{msg.extrato}</title>

	<ui:include src="/layout/Header.xhtml" />
</h:head>
<h:body>
<center>

	<h:form>
	<br/>
	<table><tr>
	<td>
		<p:outputLabel for="from" value="#{msg.from}:" />  
		<p:calendar style="width: 15px" maxlength="10"  id="from" mindate="#{date.dataAtualMenos90}" maxdate="#{date.dataAtual}"
				value="#{transacaoManagedBean.fromDate}"  pattern="dd/MM/yyyy" required="true"
        	requiredMessage="#{msg.data} (#{msg.from}): #{msg.campoObrigatorio}"
        	converterMessage="#{msg.data} (#{msg.from}): #{msg.valorInvalido}" >
        		<f:convertDateTime pattern="dd/MM/yyyy" />
        	</p:calendar>
	</td>
	<td>
		<p:outputLabel for="until" value="#{msg.until}:" />
		<p:calendar style="width: 15px" maxlength="10"  id="until" mindate="#{date.dataAtualMenos30}" maxdate="#{date.dataAtual}"
				value="#{transacaoManagedBean.untilDate}" pattern="dd/MM/yyyy" required="true"
        	requiredMessage="#{msg.data} (#{msg.until}): #{msg.campoObrigatorio}"
        	converterMessage="#{msg.data} (#{msg.until}): #{msg.valorInvalido}" >
        		<f:convertDateTime pattern="dd/MM/yyyy" />
        	</p:calendar>
	</td>
	<td>
		<h:commandButton value="#{msg.submitExtract}" action="#{transacaoManagedBean.listarExtrato}" />
	</td> 
	</tr></table>
	</h:form>
	
		<h:message for="from" style="color:red" /> <br/>
		<h:message for="until" style="color:red" /> <br/>
	
	
	<h:form>	
	<br/>
	<div style="width:85%">
	<p:dataTable var="i" value="#{listaExtrato}">
		 <f:facet name="header">
           #{msg.extrato}
       	 </f:facet>
	    <p:column headerText="#{msg.data}" style="width:8%">
	        <h:outputText value="#{i.data}" >
	        	<f:convertDateTime pattern="dd/MM/yyyy" />
	        </h:outputText>
	    </p:column>
	 
	    <p:column headerText="#{msg.tipoTransacao}" style="width:22%">
	        <h:outputText value="#{i.tipoTransacao}" />
	    </p:column>
	 	 
	    <p:column headerText="#{msg.descricao}" style="width:22%">
	        <h:outputText value="#{i.descricao}" />
	    </p:column>
	    
	    <p:column headerText="#{msg.agenciaR}" style="width:8%">
	        <h:outputText value="#{i.agenciaR}" />
	    </p:column>
	    
	    <p:column headerText="#{msg.contaR}" style="width:8%">
	        <h:outputText value="#{i.contaR}" />
	    </p:column>
	    
	    <p:column headerText="#{msg.agenciaD}" style="width:7%">
	        <h:outputText value="#{i.agenciaD}" />
	    </p:column>
	    
	    <p:column headerText="#{msg.contaD}" style="width:7%">
	        <h:outputText value="#{i.contaD}" />
	    </p:column>
	    
	    <p:column headerText="#{msg.valor}" style="width:10%">
	        R$ <h:outputText value="#{i.valor}" >
	        	<f:convertNumber minFractionDigits="2" />
	        </h:outputText>
	    </p:column>
	    
	    <p:column headerText="#{msg.saldo}" style="width:10%">
	        R$ <h:outputText value="#{i.saldo}" >
	        	<f:convertNumber minFractionDigits="2" />
	        </h:outputText>
	    </p:column>
	    
	</p:dataTable>
	</div>
	
	<br/>
	*#{msg.selectPeriodo}
	</h:form>
</center>	
</h:body>
</f:view>
</html>